package words.extractor;

import java.util.List;

import stemmer.Stemmer;
import wordnet.IWordnetOperator;
import words.tokenizer.WordsTokenizer;

public class WordsExtractor {
	
	private Stemmer _stemmer;
	private IWordnetOperator _wordnet;
	public WordsExtractor(IWordnetOperator wordnet, Stemmer stemmer){
		_stemmer = stemmer;
		_wordnet = wordnet;
	}
	
	

	public List<String> extractFromUsing(String text, int nWords) {
		WordsTokenizer tokenizer = new WordsTokenizer(_stemmer);
		List<String> words = tokenizer.tokenize(text);
		List<String> nWordsList = tokenizer.nGramsOfLastText(nWords,true);
		_wordnet.makeSubstitutionWithHypernymsIn(words);
//		_wordnet.expandsWithHypernyms(words);
		
		words.addAll(nWordsList);
		return words;
	}







	



	

}
